Ext.define('DragonApp.view.foundation.Grid', {
    extend: 'Ext.grid.Panel',

    alias: 'widget.base-grid',

    requires: [
        'DragonApp.util.Glyphs'
    ],

    columnLines: true,

    viewConfig: {
        enableTextSelection: true
    },

    initComponent: function() {
        var me = this;

        me.columns = Ext.Array.merge(
            me.columns, [{
                xtype: 'widgetcolumn',
                width: 100,
                sortable: false,
                hideable: false,
                menuDisabled: true,
                widget: {
                    xtype: 'button',
                    text: '编辑',
                    width: 80,
                    glyph: DragonApp.util.Glyphs.getGlyph('edit'),
                    tooltip: '编辑',
                    handler: 'onEdit'
                },
                itemId: 'edit'
            }, {
                xtype: 'widgetcolumn',
                width: 100,
                sortable: false,
                hideable: false,
                menuDisabled: true,
                widget: {
                    xtype: 'button',
                    text: '删除',
                    width: 80,
                    glyph: DragonApp.util.Glyphs.getGlyph('destroy'),
                    tooltip: '删除',
                    handler: 'onDelete'
                },
                itemId: 'delete'
            }]);

        me.callParent(arguments);
    }
});